#!/usr/bin/env python
#coding:utf-8

import os
import sys

CDROM = '/home/wwq/py/gp'

print sys.argv
def cdWalker(cdrom, cdcfile):
    export = ''
    for root, dirs, files in os.walk(cdrom):
        export += "\n Root: %s;\n Dirs: %s;\n Files: %s\n ------"%(root, dirs, files)
    open(cdcfile, 'w').write(export)

if '-e' == sys.argv[1]:
    cdWalker(CDROM, sys.argv[2])
    print "记录光盘信息到%s"%sys.argv[2]
else:
    print '''
    PyCDC 使用方法：
    python pycdc.py -e mycd1-1.cdc
    #将光盘内容记录为 mycd1-1.cdc
    '''
